//
//  CityTourCardCell.m
//  ImGuider
//
//  Created by 王鹏宇 on 2017/6/8.
//  Copyright © 2017年 imguider. All rights reserved.
//

#import "CityTourCardCell.h"

@implementation CityTourCardCell


- (IBAction)guiderBtnClicked:(id)sender {
    
    [MobClick event:@"2_1_3"];
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    [IGUtils viewShowShadow:self.contentView shadowRadius:3 shadowOpacity:0.2 WithColor:[UIColor blackColor]];
    // Initialization code
    
    
    self.guiderNameLabel.textColor = kSubitleColor;
    
    if (ISiPhone5) {
        self.lineNameLabel.font = Font(14);
    }else {
        self.lineNameLabel.font = Font(17);
    }
    self.lineNameLabel.textColor = kTitleColor;
    self.timeLabel.textColor = kContentColor;
    
    self.lineNameLabel.textColor = kTitleColor;
    self.guiderNameLabel.textColor = kContentColor;
    self.timeLabel.textColor = kContentColor;
    self.lisenCountLabel.textColor = kContentColor;
    
    self.tagView.tagViewWidth = self.tagViewW;
    self.tagViewW.constant = 0;
}


- (void)configDataWith:(LineModel *)model {
    
    [self.cityImageView setImageURL:[NSURL URLWithString:model.pictureArray.firstObject] placeholderImage:[UIImage imageNamed:@"placeholder_squ"]];
    self.guiderIconView.headerImageName = model.guide.headimg;
    self.guiderIconView.vip = model.guide.vip;
    
    self.guiderNameLabel.text = model.guide.realname;
    self.lineNameLabel.text = model.linename;
    self.lisenCountLabel.text = [NSString stringWithFormat:@"%@",model.visits];
    self.timeLabel.text = [NSString stringWithFormat:@"%@min",model.timelabel];
    self.tagView.tagsArray = model.tagArray;
    
    [self.starView setScore:model.score.floatValue/10];
    switch (model.transport.integerValue) {
        case 1:
            self.transportImageView.image = [UIImage  imageNamed:@"urbanline_foot"];
            break;
        case 2:
            self.transportImageView.image = [UIImage  imageNamed:@"urbanline_bus"];
            break;
        case 3:
            self.transportImageView.image = [UIImage  imageNamed:@"urbanline_ship"];
            break;
        case 4:
            self.transportImageView.image = [UIImage  imageNamed:@"urbanline_car"];
            break;
            
        default:
            self.transportImageView.image = [UIImage  imageNamed:@"urbanline_foot"];
            break;
    }

}
@end
